<?php

class EnterpriseMain extends Node
{

    protected $commercial_name;
    protected $logo;
    protected $organization;
    protected $section_policy = 'projects_updates';
    protected $section_id = 'projects_updates';

    function __construct()
    {
        $_SESSION[ 'organization' ] = $this->organization;
        $_SESSION[ 'enterprise' ] = $this->id;
    }

    function setSection( $section, $id )
    {
        $this->section_policy = $section;
        $this->section_id = $id;
    }

    function handleGET( Event $e )
    {
        if ( $e->tag == 'change_section' ) {

            if ( in_array( $_GET[ 'section' ],
                            array( 'projects_updates', 'projects_list', 'users_enterprise_list' ) ) )
                    $this->_setSection( $_GET[ 'section' ], $_GET[ 'section' ] );

            $e->cancelBubble();
        }
        else if ( $e->tag == 'projectmilestone' ) {
            $this->_setSection( 'projectmilestone', $e->source->id );
            $e->cancelBubble();
        }
    }

    function fill()
    {
        $this->appendChild( Node::getInstance( $this->section_policy,
                        $this->section_id ) );
    }

}

?>
